/**
 */
package fUML.Semantics.Loci.LociL1;

import fUML.Semantics.Classes.Kernel.ExtensionalValue;

import fUML.Syntax.Classes.Kernel.Classifier;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EObject;

/**
 * <!-- begin-user-doc -->
 * A representation of the model object '<em><b>Locus</b></em>'.
 * <!-- end-user-doc -->
 *
 * <!-- begin-model-doc -->
 * A locus is a place at which extensional values (objects or links) can exist. The
 *                 extent of a class or association is the set of objects or links of that type that
 *                 exist at a certain locus.
 *  A locus also has an executor and a factory
 *                 associated with it, used to execute behaviors as a result of requests dispatched to
 *                 objects at the locus.
 * <!-- end-model-doc -->
 *
 * <p>
 * The following features are supported:
 * <ul>
 *   <li>{@link fUML.Semantics.Loci.LociL1.Locus#getFactory <em>Factory</em>}</li>
 *   <li>{@link fUML.Semantics.Loci.LociL1.Locus#getExecutor <em>Executor</em>}</li>
 *   <li>{@link fUML.Semantics.Loci.LociL1.Locus#getExtensionalValues <em>Extensional Values</em>}</li>
 * </ul>
 * </p>
 *
 * @see fUML.Semantics.Loci.LociL1.LociL1Package#getLocus()
 * @model
 * @generated
 */
public interface Locus extends EObject {
	/**
	 * Returns the value of the '<em><b>Factory</b></em>' containment reference.
	 * It is bidirectional and its opposite is '{@link fUML.Semantics.Loci.LociL1.ExecutionFactory#getLocus <em>Locus</em>}'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * The factory to be used at this locus.
	 * <!-- end-model-doc -->
	 * @return the value of the '<em>Factory</em>' containment reference.
	 * @see #setFactory(ExecutionFactory)
	 * @see fUML.Semantics.Loci.LociL1.LociL1Package#getLocus_Factory()
	 * @see fUML.Semantics.Loci.LociL1.ExecutionFactory#getLocus
	 * @model opposite="locus" containment="true" ordered="false"
	 * @generated
	 */
	ExecutionFactory getFactory();

	/**
	 * Sets the value of the '{@link fUML.Semantics.Loci.LociL1.Locus#getFactory <em>Factory</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Factory</em>' containment reference.
	 * @see #getFactory()
	 * @generated
	 */
	void setFactory(ExecutionFactory value);

	/**
	 * Returns the value of the '<em><b>Executor</b></em>' containment reference.
	 * It is bidirectional and its opposite is '{@link fUML.Semantics.Loci.LociL1.Executor#getLocus <em>Locus</em>}'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * The executor to be used at this locus.
	 * <!-- end-model-doc -->
	 * @return the value of the '<em>Executor</em>' containment reference.
	 * @see #setExecutor(Executor)
	 * @see fUML.Semantics.Loci.LociL1.LociL1Package#getLocus_Executor()
	 * @see fUML.Semantics.Loci.LociL1.Executor#getLocus
	 * @model opposite="locus" containment="true" ordered="false"
	 * @generated
	 */
	Executor getExecutor();

	/**
	 * Sets the value of the '{@link fUML.Semantics.Loci.LociL1.Locus#getExecutor <em>Executor</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @param value the new value of the '<em>Executor</em>' containment reference.
	 * @see #getExecutor()
	 * @generated
	 */
	void setExecutor(Executor value);

	/**
	 * Returns the value of the '<em><b>Extensional Values</b></em>' containment reference list.
	 * The list contents are of type {@link fUML.Semantics.Classes.Kernel.ExtensionalValue}.
	 * It is bidirectional and its opposite is '{@link fUML.Semantics.Classes.Kernel.ExtensionalValue#getLocus <em>Locus</em>}'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * The set of values that are members of classifier extents at this locus.
	 * <!-- end-model-doc -->
	 * @return the value of the '<em>Extensional Values</em>' containment reference list.
	 * @see fUML.Semantics.Loci.LociL1.LociL1Package#getLocus_ExtensionalValues()
	 * @see fUML.Semantics.Classes.Kernel.ExtensionalValue#getLocus
	 * @model opposite="locus" containment="true" ordered="false"
	 * @generated
	 */
	EList<ExtensionalValue> getExtensionalValues();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * // Set the executor for this locus.
	 *  
	 *  this.executor =
	 *                   executor;
	 *  this.executor.locus = this;
	 *  
	 * <!-- end-model-doc -->
	 * @model executorRequired="true" executorOrdered="false"
	 * @generated
	 */
	void fUML_setExecutor(Executor executor);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * // Set the factory for this locus.
	 *  
	 *  this.factory =
	 *                   factory;
	 *  this.factory.locus = this;
	 *  
	 * <!-- end-model-doc -->
	 * @model factoryRequired="true" factoryOrdered="false"
	 * @generated
	 */
	void fUML_setFactory(ExecutionFactory factory);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * // Return the set of extensional values at this locus which have the given
	 *                   classifier as a type.
	 *  
	 *  ExtensionalValueList extent = new
	 *                   ExtensionalValueList();
	 *  
	 *  ExtensionalValueList extensionalValues
	 *                   = this.extensionalValues;
	 *  for (int i = 0; i <
	 *                   extensionalValues.size(); i++) {
	 *  ExtensionalValue value =
	 *                   extensionalValues.getValue(i);
	 *  ClassifierList types =
	 *                   value.getTypes();
	 *  
	 *  boolean conforms = false;
	 *  int j =
	 *                   1;
	 *  while (!conforms & j <= types.size()) {
	 *                   conforms = this.conforms(types.getValue(j-1), classifier);
	 *  j = j +
	 *                   1;
	 *  }
	 *  
	 *  if (conforms) {
	 *                   extent.addValue(value);
	 *  }
	 *  }
	 *  
	 *  return
	 *                   extent;
	 *  
	 * <!-- end-model-doc -->
	 * @model ordered="false" classifierRequired="true" classifierOrdered="false"
	 * @generated
	 */
	EList<ExtensionalValue> getExtent(Classifier classifier);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * // Add the given extensional value to this locus
	 *  
	 *                   value.locus = this;
	 *  this.extensionalValues.addValue(value);
	 *                 
	 * <!-- end-model-doc -->
	 * @model valueRequired="true" valueOrdered="false"
	 * @generated
	 */
	void add(ExtensionalValue value);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * // Remove the given extensional value from this locus.
	 *  
	 *                   value.locus = null;
	 *  
	 *  boolean notFound = true;
	 *  int i =
	 *                   1;
	 *  while (notFound & i <= this.extensionalValues.size())
	 *                   {
	 *  if (this.extensionalValues.getValue(i-1) == value) {
	 *                   this.extensionalValues.remove(i-1);
	 *  notFound = false;
	 *  }
	 *                   i = i + 1;
	 *  }
	 *  
	 * <!-- end-model-doc -->
	 * @model valueRequired="true" valueOrdered="false"
	 * @generated
	 */
	void remove(ExtensionalValue value);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * // Instantiate the given class at this locus.
	 *  
	 *  Object_
	 *                   object = null;
	 *  
	 *  if (type instanceof Behavior) {
	 *  object
	 *                   = this.factory.createExecution((Behavior)type, null);
	 *  }
	 *  else
	 *                   {
	 *  object = new Object_();
	 *  
	 *                   object.types.addValue(type);
	 *  object.createFeatureValues();
	 *                   this.add(object);
	 *  }
	 *  
	 *  return object;
	 *  
	 * <!-- end-model-doc -->
	 * @model required="true" ordered="false" typeRequired="true" typeOrdered="false"
	 * @generated
	 */
	fUML.Semantics.Classes.Kernel.Object instantiate(fUML.Syntax.Classes.Kernel.Class type);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * // Test if a type conforms to a given classifier, that is, the type is equal
	 *                   to or a descendant of the classifier.
	 *  
	 *  boolean doesConform =
	 *                   false;
	 *  
	 *  if (type == classifier) {
	 *  doesConform =
	 *                   true;
	 *  } else {
	 *  int i = 1;
	 *  while (!doesConform &
	 *                   i <= type.general.size()) {
	 *  doesConform =
	 *                   this.conforms(type.general.getValue(i-1), classifier);
	 *  i = i +
	 *                   1;
	 *  }
	 *  }
	 *  
	 *  return doesConform;
	 *  
	 *                   
	 *  
	 * <!-- end-model-doc -->
	 * @model required="true" ordered="false" typeRequired="true" typeOrdered="false" classifierRequired="true" classifierOrdered="false"
	 * @generated
	 */
	boolean conforms(Classifier type, Classifier classifier);

} // Locus
